home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 16643 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  3.2 KB

  1. Path: news.wwa.com!rmartin
  2. From: rmartin@oma.com (Robert C. Martin)
  3. Newsgroups: comp.object,comp.lang.c++,comp.realtime,comp.dcom.telecom.tech,comp.arch.embedded
  4. Subject: Re: Can OO be successful in real-time embedded systems?
  5. Date: 11 Apr 1996 16:32:22 GMT
  6. Organization: Object Mentor
  7. Message-ID: <RMARTIN.96Apr11113222@rcm.oma.com>
  8. References: <316BF0C5.1FE1@condat.de>
  9. NNTP-Posting-Host: rcm.oma.com
  10. In-reply-to: Henning Rietz's message of Wed, 10 Apr 1996 17:32:53 +0000
  11.  
  12. In article <316BF0C5.1FE1@condat.de> Henning Rietz <rietz@condat.de> writes:
  13.  
  14.    For the last couple of weeks I have been involved in a major survey on
  15.    the use of object oriented techniques in the area of telecommunications
  16.    (mainly in the German speaking region).
  17.    I can say "everybody" is using OO in some areas (mainly network
  18.    management, switch provisioning, customer care), BUT there are (almost)
  19.    no examples in the area of (small) embedded systems, main reasons for
  20.    that being:
  21.  
  22.        - "OO systems are too slow"
  23.        - "OO systems eat up too much memory"
  24.  
  25. More than one of my clients are using OO and C++ in embedded,
  26. multi-threaded, real time systems, and they are getting along quite
  27. nicely.  The systems I am talking about are extremely constrained.
  28. There are dozens of real time tasks with millisecond response times.
  29. There is a very limitted amount of memory. etc.  They are concerned
  30. for every wasted microsecond.  Yet they are finding that C++ and OOD
  31. are more than adequate to the task.
  32.  
  33. What is it that would make OO slow?  Some people contend that it is
  34. the time required for polymorphic dispatch.  (i.e. figuring out which
  35. method to call when a message is recieved.)  In C++ this is very very
  36. fast.  Indeed I recently benchmarked a 486-33 using a popular
  37. compiler and found that the polymorphic dispatch time was 140ns.
  38.  
  39. Moreover, polymorphic dispatch in OO applications replaces
  40. if-else or switch statements in equivalent procedural applications.
  41. So the comparison is probably moot.  Neither is faster or slower than
  42. the other given a decent compiler.
  43.  
  44. As to memory, C++ requires a bit more memory for managing the virtual
  45. tables.  This amounts to one pointer per object, and one virtual table
  46. per class.  Each virtual table contains one pointer per virtual
  47. function and probably a few other bytes for miscellaneous stuff.
  48. These tables can be placed in ROM.
  49.  
  50. However, these tables and the virtual pointers replace switch/case
  51. tables or if/else code that would exist in the procedural counterpart.
  52. So the difference is probably moot.
  53.  
  54.          How far "down" does the application of OO really go?
  55.  
  56. As far down as you like.  C++ code in interrupt heads is not out of
  57. the question.
  58.  
  59.          How far will it go in the future?
  60.  
  61. I anticipate no lower bound.
  62.  
  63.          Who develops commercial(!) embedded real-time systems
  64.          using OO methods and languages?
  65.  
  66. If you would like to contact me, I will ask my clients if they would
  67. be willing to share their experiences with you.
  68.  
  69.          Will OO ever be of major importance in that area?
  70.  
  71. It already is.
  72. --
  73. Robert Martin       | Design Consulting   | Training courses offered:
  74. Object Mentor Assoc.| rmartin@oma.com     |   OOA/D, C++, Advanced OO
  75. 14619 N. Somerset Cr| Tel: (847) 918-1004 |   Mgt. Overview of OOT
  76. Green Oaks IL 60048 | Fax: (847) 918-1023 | http://www.oma.com
  77.  
  78.